package com.neuedu.servlet.business;


import com.neuedu.service.BusinessService;
import com.neuedu.service.Imp.BusinessServiceImp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/updateBus")
public class UpdateBusinessServlet extends HttpServlet {
    private BusinessService businessService = new BusinessServiceImp();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");

        String account = req.getParameter("account");
        String password = req.getParameter("password");
        String telephone = req.getParameter("telephone");
        String contact = req.getParameter("contact");
        String id = req.getParameter("id");

        Integer i = businessService.updateBus(account,password,telephone,contact,id);
        resp.getWriter().write(i + "");
    }
}
